package fr.resasante.ejb.dto;

// Generated 6 sept. 2012 16:37:33 by Hibernate Tools 3.4.0.CR1

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * User generated by hbm2java
 */
@Entity
@Table(name = "user", catalog = "resasante", uniqueConstraints = {
		@UniqueConstraint(columnNames = "mail"),
		@UniqueConstraint(columnNames = "rpps_number"),
		@UniqueConstraint(columnNames = "adeli_number"),
		@UniqueConstraint(columnNames = "username"), @UniqueConstraint(columnNames = "salt") })
public class User implements java.io.Serializable {

	private Integer userId;
	private String userType;
	private String username;
	private String mail;
	private String password;
	private boolean enabled;
	private String lastname;
	private String firstname;
	private String gender;
	private String title;
	private String job;
	private String speciality;
	private String adeliNumber;
	private String corporateName;
	private String rppsNumber;
	private String postalAddress;
	private String postalCode;
	private String postOfficeBox;
	private String city;
	private String departmentCode;
	private String departmentLabel;
	private String lat;
	private String lng;
	private String agreement;
	private String businessPhone;
	private String gsmPhone;
	private String fax;
	private String salt;
	private Set<UserRole> userRoles = new HashSet<UserRole>(0);

	public User() {
	}

	public User(String userType, String username, String mail, String password,
			boolean enabled, String lastname, String firstname, String gender, String job,
			String corporateName, String postalAddress, String postalCode, String city,
			String departmentCode, String departmentLabel, String lat, String lng,
			String agreement, String businessPhone, String salt) {
		this.userType = userType;
		this.username = username;
		this.mail = mail;
		this.password = password;
		this.enabled = enabled;
		this.lastname = lastname;
		this.firstname = firstname;
		this.gender = gender;
		this.job = job;
		this.corporateName = corporateName;
		this.postalAddress = postalAddress;
		this.postalCode = postalCode;
		this.city = city;
		this.departmentCode = departmentCode;
		this.departmentLabel = departmentLabel;
		this.lat = lat;
		this.lng = lng;
		this.agreement = agreement;
		this.businessPhone = businessPhone;
		this.salt = salt;
	}

	public User(String userType, String username, String mail, String password,
			boolean enabled, String lastname, String firstname, String gender, String title,
			String job, String speciality, String adeliNumber, String corporateName,
			String rppsNumber, String postalAddress, String postalCode, String postOfficeBox,
			String city, String departmentCode, String departmentLabel, String lat,
			String lng, String agreement, String businessPhone, String gsmPhone, String fax,
			String salt, Set<UserRole> userRoles) {
		this.userType = userType;
		this.username = username;
		this.mail = mail;
		this.password = password;
		this.enabled = enabled;
		this.lastname = lastname;
		this.firstname = firstname;
		this.gender = gender;
		this.title = title;
		this.job = job;
		this.speciality = speciality;
		this.adeliNumber = adeliNumber;
		this.corporateName = corporateName;
		this.rppsNumber = rppsNumber;
		this.postalAddress = postalAddress;
		this.postalCode = postalCode;
		this.postOfficeBox = postOfficeBox;
		this.city = city;
		this.departmentCode = departmentCode;
		this.departmentLabel = departmentLabel;
		this.lat = lat;
		this.lng = lng;
		this.agreement = agreement;
		this.businessPhone = businessPhone;
		this.gsmPhone = gsmPhone;
		this.fax = fax;
		this.salt = salt;
		this.userRoles = userRoles;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "user_id", unique = true, nullable = false)
	public Integer getUserId() {
		return this.userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	@Column(name = "user_type", nullable = false, length = 13)
	public String getUserType() {
		return this.userType;
	}

	public void setUserType(String userType) {
		this.userType = userType;
	}

	@Column(name = "username", unique = true, nullable = false, length = 45)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "mail", unique = true, nullable = false)
	public String getMail() {
		return this.mail;
	}

	public void setMail(String mail) {
		this.mail = mail;
	}

	@Column(name = "password", nullable = false, length = 45)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "enabled", nullable = false)
	public boolean isEnabled() {
		return this.enabled;
	}

	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}

	@Column(name = "lastname", nullable = false)
	public String getLastname() {
		return this.lastname;
	}

	public void setLastname(String lastname) {
		this.lastname = lastname;
	}

	@Column(name = "firstname", nullable = false)
	public String getFirstname() {
		return this.firstname;
	}

	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}

	@Column(name = "gender", nullable = false, length = 6)
	public String getGender() {
		return this.gender;
	}

	public void setGender(String gender) {
		this.gender = gender;
	}

	@Column(name = "title", length = 3)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "job", nullable = false)
	public String getJob() {
		return this.job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	@Column(name = "speciality")
	public String getSpeciality() {
		return this.speciality;
	}

	public void setSpeciality(String speciality) {
		this.speciality = speciality;
	}

	@Column(name = "adeli_number", unique = true, length = 9)
	public String getAdeliNumber() {
		return this.adeliNumber;
	}

	public void setAdeliNumber(String adeliNumber) {
		this.adeliNumber = adeliNumber;
	}

	@Column(name = "corporate_name", nullable = false)
	public String getCorporateName() {
		return this.corporateName;
	}

	public void setCorporateName(String corporateName) {
		this.corporateName = corporateName;
	}

	@Column(name = "rpps_number", unique = true, length = 11)
	public String getRppsNumber() {
		return this.rppsNumber;
	}

	public void setRppsNumber(String rppsNumber) {
		this.rppsNumber = rppsNumber;
	}

	@Column(name = "postal_address", nullable = false)
	public String getPostalAddress() {
		return this.postalAddress;
	}

	public void setPostalAddress(String postalAddress) {
		this.postalAddress = postalAddress;
	}

	@Column(name = "postal_code", nullable = false, length = 10)
	public String getPostalCode() {
		return this.postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	@Column(name = "post_office_box")
	public String getPostOfficeBox() {
		return this.postOfficeBox;
	}

	public void setPostOfficeBox(String postOfficeBox) {
		this.postOfficeBox = postOfficeBox;
	}

	@Column(name = "city", nullable = false)
	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	@Column(name = "department_code", nullable = false, length = 2)
	public String getDepartmentCode() {
		return this.departmentCode;
	}

	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}

	@Column(name = "department_label", nullable = false)
	public String getDepartmentLabel() {
		return this.departmentLabel;
	}

	public void setDepartmentLabel(String departmentLabel) {
		this.departmentLabel = departmentLabel;
	}

	@Column(name = "lat", nullable = false)
	public String getLat() {
		return this.lat;
	}

	public void setLat(String lat) {
		this.lat = lat;
	}

	@Column(name = "lng", nullable = false)
	public String getLng() {
		return this.lng;
	}

	public void setLng(String lng) {
		this.lng = lng;
	}

	@Column(name = "agreement", nullable = false, length = 3)
	public String getAgreement() {
		return this.agreement;
	}

	public void setAgreement(String agreement) {
		this.agreement = agreement;
	}

	@Column(name = "business_phone", nullable = false, length = 15)
	public String getBusinessPhone() {
		return this.businessPhone;
	}

	public void setBusinessPhone(String businessPhone) {
		this.businessPhone = businessPhone;
	}

	@Column(name = "gsm_phone", length = 15)
	public String getGsmPhone() {
		return this.gsmPhone;
	}

	public void setGsmPhone(String gsmPhone) {
		this.gsmPhone = gsmPhone;
	}

	@Column(name = "fax", length = 15)
	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	@Column(name = "salt", unique = true, nullable = false)
	public String getSalt() {
		return this.salt;
	}

	public void setSalt(String salt) {
		this.salt = salt;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "user")
	public Set<UserRole> getUserRoles() {
		return this.userRoles;
	}

	public void setUserRoles(Set<UserRole> userRoles) {
		this.userRoles = userRoles;
	}

	// The following is extra code specified in the hbm.xml files

	/**
	 * Default serial version ID
	 */
	private static final long serialVersionUID = 1L;

	// end of extra code specified in the hbm.xml files

}
